﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeLineSeg2d : OdGeLinearEnt2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeLineSeg2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeLineSeg2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeLineSeg2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeLineSeg2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeLineSeg2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeLineSeg2d() : this(GlobalsPINVOKE.new_OdGeLineSeg2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLineSeg2d(OdGeLineSeg2d source) : this(GlobalsPINVOKE.new_OdGeLineSeg2d__SWIG_1(OdGeLineSeg2d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLineSeg2d(OdGePoint2d point1, OdGePoint2d point2) : this(GlobalsPINVOKE.new_OdGeLineSeg2d__SWIG_2(OdGePoint2d.getCPtr(point1), OdGePoint2d.getCPtr(point2)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLineSeg2d(OdGePoint2d point, OdGeVector2d vect) : this(GlobalsPINVOKE.new_OdGeLineSeg2d__SWIG_3(OdGePoint2d.getCPtr(point), OdGeVector2d.getCPtr(vect).Handle), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLineSeg2d set(OdGePoint2d point, OdGeVector2d vect)
		{
			OdGeLineSeg2d result = new OdGeLineSeg2d(GlobalsPINVOKE.OdGeLineSeg2d_set__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeVector2d.getCPtr(vect).Handle), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeLineSeg2d set(OdGePoint2d point1, OdGePoint2d point2)
		{
			OdGeLineSeg2d result = new OdGeLineSeg2d(GlobalsPINVOKE.OdGeLineSeg2d_set__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(point1), OdGePoint2d.getCPtr(point2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeLineSeg2d set(OdGeCurve2d curve1, OdGeCurve2d curve2, out double param1, out double param2, out bool success)
		{
			OdGeLineSeg2d result = new OdGeLineSeg2d(GlobalsPINVOKE.OdGeLineSeg2d_set__SWIG_2(this.swigCPtr, OdGeCurve2d.getCPtr(curve1), OdGeCurve2d.getCPtr(curve2), out param1, out param2, out success), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeLineSeg2d set(OdGeCurve2d curve, OdGePoint2d point, out double param, out bool success)
		{
			OdGeLineSeg2d result = new OdGeLineSeg2d(GlobalsPINVOKE.OdGeLineSeg2d_set__SWIG_3(this.swigCPtr, OdGeCurve2d.getCPtr(curve), OdGePoint2d.getCPtr(point), out param, out success), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getBisector(OdGeLine2d line)
		{
			GlobalsPINVOKE.OdGeLineSeg2d_getBisector(this.swigCPtr, OdGeLine2d.getCPtr(line));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint2d baryComb(double blendCoeff)
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeLineSeg2d_baryComb(this.swigCPtr, blendCoeff), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d startPoint()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeLineSeg2d_startPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d midPoint()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeLineSeg2d_midPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d endPoint()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGeLineSeg2d_endPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeLineSeg2d Assign(OdGeLineSeg2d line)
		{
			OdGeLineSeg2d result = new OdGeLineSeg2d(GlobalsPINVOKE.OdGeLineSeg2d_Assign(this.swigCPtr, OdGeLineSeg2d.getCPtr(line)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
